<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('proveedores/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
          <?php echo button_to('Volver al listado','proveedores/index') ?>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;<?php echo link_to('<button>Borrar</button>', 'proveedores/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => '¿Está seguro de eliminar?')) ?>
          <?php endif; ?>
          <input type="submit" value="Guardar" />
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['comuna_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['comuna_id']->renderError() ?>
          <?php echo $form['comuna_id'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['region_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['region_id']->renderError() ?>
          <?php echo $form['region_id'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['nombre']->renderLabel() ?></th>
        <td>
          <?php echo $form['nombre']->renderError() ?>
          <?php echo $form['nombre'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['rut']->renderLabel() ?></th>
        <td>
          <?php echo $form['rut']->renderError() ?>
          <?php echo $form['rut'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['giro']->renderLabel() ?></th>
        <td>
          <?php echo $form['giro']->renderError() ?>
          <?php echo $form['giro'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['telefono']->renderLabel() ?></th>
        <td>
          <?php echo $form['telefono']->renderError() ?>
          <?php echo $form['telefono'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['direccion_web']->renderLabel() ?></th>
        <td>
          <?php echo $form['direccion_web']->renderError() ?>
          <?php echo $form['direccion_web'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['calle']->renderLabel() ?></th>
        <td>
          <?php echo $form['calle']->renderError() ?>
          <?php echo $form['calle'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['numero']->renderLabel() ?></th>
        <td>
          <?php echo $form['numero']->renderError() ?>
          <?php echo $form['numero'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['nombre_contacto']->renderLabel() ?></th>
        <td>
          <?php echo $form['nombre_contacto']->renderError() ?>
          <?php echo $form['nombre_contacto'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['correo_contacto']->renderLabel() ?></th>
        <td>
          <?php echo $form['correo_contacto']->renderError() ?>
          <?php echo $form['correo_contacto'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['telefono_contacto']->renderLabel() ?></th>
        <td>
          <?php echo $form['telefono_contacto']->renderError() ?>
          <?php echo $form['telefono_contacto'] ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>
